﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Empires.CRL.DataContract;

namespace Empires.PL.ServiceClient
{
    public static class AppBlogServiceClient
    {
        public static DefaultDataPack GetArticle(int id)
        {
            Empires.BLL.AppEngine.IService.IBlogService service =
                new Empires.BLL.AppEngine.Implement.BlogService();
            return service.GetArticle(id);
        }
        public static List<DefaultDataPack> GetArticleReply(int articleId, int page, int takeitem)
        {
            Empires.BLL.AppEngine.IService.IBlogService service =
                   new Empires.BLL.AppEngine.Implement.BlogService();
            return service.GetArticleReply(articleId, page, takeitem);
        }
        public static int PostArticle(DateTime pbdate, string author, string title, string mainimg, string shortimg, string content)
        {
            Empires.BLL.AppEngine.IService.IBlogService service =
                new Empires.BLL.AppEngine.Implement.BlogService();
            return service.PostArticle(pbdate, author, title, mainimg, shortimg, content);
        }
        public static int PostArticleReply(int articleId, string author, string content)
        {
            Empires.BLL.AppEngine.IService.IBlogService service =
                    new Empires.BLL.AppEngine.Implement.BlogService();
            return service.PostArticleReply(articleId, author, content);
        }
        public static int EditArticle(int id, string author, string title, string content)
        {
            Empires.BLL.AppEngine.IService.IBlogService service =
                new Empires.BLL.AppEngine.Implement.BlogService();
            return service.EditArticle(id, author, title, content);
        }

        public static int DeleteArticle(int id)
        {
            Empires.BLL.AppEngine.IService.IBlogService service =
                new Empires.BLL.AppEngine.Implement.BlogService();
            return service.DeleteArticle(id);
        }

        public static List<DefaultDataPack> GetBlogs(int page, int takeitem)
        {
            Empires.BLL.AppEngine.IService.IBlogService service =
                new Empires.BLL.AppEngine.Implement.BlogService();
            return service.GetBlogs(page,takeitem);
        }

        public static List<DefaultDataPack> GetPopularBlogs(int takeitem)
        {
            Empires.BLL.AppEngine.IService.IBlogService service =
               new Empires.BLL.AppEngine.Implement.BlogService();
            return service.GetPopularBlogs(takeitem);
        }
    }
}
